/*
INFO - Frankensprite - a sprite made of parts of other sprites.
Just like frankenstein is a mashup of other people's limbs. Crazy, eh?

CREDITS:

Graphics:
Gunflash - Bane
Medikit rotations - NMN\Paul
Frankensprite - Chronoteeth
Touchups by me, at any rate

Sounds:
Up, Loop, Fire, End1, End2, Charge... everything else, really - People can Fly (Bulletstorm)
Medikit and pill bounces... And Louis. - Valve (Left 4 Dead 2)

A weapon which supposed to be mere, graphical upgrade to already existing one,
it turned into a class of it's own thanks to a very simple matter - I fucked
up the missile chamber. They totally didn't look like missiles! Then again...
They looked like freaking pills. And thus a completely bonkers weapon was born.
*/

ACTOR Colonel : Weapon 24508
{
	//$Category Weapons
	//$Title Colonel Pillskanone
	//$Sprite CLNGX0
	Tag "Colonel Pillskanone"
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "You've got the K3RN3L ''Colonel'' Pillskanone! Stop da poop NAO! (6)" //Note: Only inside circles of me and KeksDose will get this joke. Or if you watched extremely crappily voiceacted megaman cutscenes, which means we have terrible things to laugh about.
	Obituary "%k meant to do no harm, but %o just called to be served with explosive medicine."
	Weapon.UpSound "Weapons/Colonel/Up"
	Weapon.SelectionOrder 3
	Weapon.AmmoGive 20
	Weapon.AmmoType "RawketAmmo"
	Weapon.AmmoUse 1
	Weapon.AmmoType2 "RawketAmmo"
	Weapon.AmmoUse2 5
	Weapon.Kickback 30
	Weapon.SlotNumber 6
    Weapon.BobStyle InverseSmooth
    Weapon.BobSpeed 1.4
    Weapon.BobRangeY 0.6
    Weapon.BobRangeX 1.4
	Scale 0.9
	+ALT_AMMO_OPTIONAL
	States 
	{
   	Spawn:
		CLNG X -1
		Stop
	Ready:
		CLNG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
 		Loop
	Deselect:
		CLNG A 0 A_TakeInventory("PillsSeq",26)
		CLNG A 0 A_StopSound(1)
		CLNG A 0 A_StopSound(5)
		CLNG A 0 A_StopSound(6)
		CLNG A 0 A_ZoomFactor(1)
		CLNG A 1 A_Lower
		CLNG A 0 A_Lower
		Loop
	Select:
		CLNG A 1 A_Raise
		CLNG A 0 A_Raise
		Loop
	Fire:
		CLNF A 0 A_PlaySound("Weapons/PowerOverwhelmingAddLoop",1,1.0,1)
		CLNF A 0 A_PlaySound("Weapons/Colonel/Loop",5,0.7,1)
		CLNF A 0 A_PlaySound("Weapons/Colonel/Fire",6,0.7,1)
		
		CLNF A 0 A_Recoil(0.15)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_SetAngle(Angle-0.25)
		CLNF A 0 A_SetPitch(Pitch-0.25)
		CLNF A 0 A_SetBlend("Red",0.09,10)
		CLNF A 0 A_Quake(1,3,0,64,"none")	
		CLNF A 0 A_FireCustomMissile("PillProjectile",frandom(-5.00,5.00), 1, 10+frandom(-1.00,1.00), frandom(-1.00,1.00), 0, frandom(-5.00,5.00)) 
		CLNF AAAAAAAAA 0 A_FireCustomMissile("PillProjectile",frandom(-5.00,5.00), 0, 10+frandom(-1.00,1.00), frandom(-1.00,1.00), 0, frandom(-5.00,5.00)) 
		CLNF A 1 Bright Offset(8,40) A_ZoomFactor(0.9575)
		CLNF A 0 A_SetAngle(Angle-0.15)
		CLNF A 0 A_SetPitch(Pitch-0.15)
      	CLNF B 1 Bright Offset(7,39) A_ZoomFactor(0.955)
		CLNG A 1 Offset(6,38) A_ZoomFactor(0.96)
		
		CLNF A 0 A_Recoil(0.15)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_SetAngle(Angle-0.25)
		CLNF A 0 A_SetPitch(Pitch-0.25)
		CLNF A 0 A_SetBlend("Red",0.1,10)
		CLNF A 0 A_Quake(1,9,0,64,"none")
		CLNF A 0 A_FireCustomMissile("PillProjectile",frandom(-5.00,5.00), 0, 10+frandom(-1.00,1.00), frandom(-1.00,1.00), 0, frandom(-5.00,5.00)) 
		CLNF AAAAAAAAA 0 A_FireCustomMissile("PillProjectile",frandom(-5.00,5.00), 0, 10+frandom(-1.00,1.00), frandom(-1.00,1.00), 0, frandom(-5.00,5.00)) 
		CLNF A 1 Bright Offset(8,40) A_ZoomFactor(0.9575)
		CLNF A 0 A_SetAngle(Angle-0.15)
		CLNF A 0 A_SetPitch(Pitch-0.15)
      	CLNF B 1 Bright Offset(7,39) A_ZoomFactor(0.955)
		CLNG A 1 Offset(6,38) A_ZoomFactor(0.96)
		CLNG A 0 A_JumpIfNoAmmo("Endler")
		CLNG A 0 A_ReFire
	Endler:
		CLNF A 0 A_PlaySound("Weapons/Colonel/End1",1,1.0)
		CLNF A 0 A_PlaySound("Weapons/Colonel/End2",5,0.8)
		CLNF A 0 A_StopSound(6)
      	CLNG B 1 Offset(6,38) A_ZoomFactor(0.965)
      	CLNG C 1 Offset(5,37) A_ZoomFactor(0.97)
      	CLNG D 1 Offset(4,36) A_ZoomFactor(0.975)
      	CLNG E 1 Offset(3,35) A_ZoomFactor(0.98)
      	CLNG A 1 Offset(2,34) A_ZoomFactor(0.985)
      	CLNG B 1 Offset(1,33) A_ZoomFactor(0.99)
      	CLNG C 1 Offset(0,32) A_ZoomFactor(0.995)
      	CLNG D 1 A_ZoomFactor(1)
      	CLNG EABCDE 1 A_WeaponReady(WRF_NOBOB)
      	CLNG AB 2 A_WeaponReady(WRF_NOBOB)
      	CLNG CDE 3 A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Nope:
		CLNG A 0 A_PlaySound("Weapons/Colonel/Nope",1,1.0,1)
		CLNG A 0 A_Quake(1,4,0,2,"none")
		CLNG A 35 A_WeaponReady(WRF_NOFIRE)
		Goto Ready
	AltFire:
	    CLNG A 0 A_JumpIfInventory("RawketAmmo",5,1)
		Goto Nope
		CLNG A 0 A_PlaySound("Weapons/Colonel/Alt1",5,0.9)
		CLNG A 0 A_PlaySound("Weapons/Colonel/Start",6,0.8)
		CLNG AB 3
		CLNF A 0 A_Quake(1,20,0,64,"none")
		CLNG CD 2
		CLNG EABCDEABCDE 1
		CLNG A 0 A_PlaySound("Weapons/Colonel/Charge",6,0.6,1)
	Charge1:
		CLNF A 0 A_Quake(2,20,0,64,"none")
		CLNG A 0 A_GiveInventory("PillsSeq",3)
	ChargeLoop1:
	    CLNG A 0 A_TakeInventory("PillsSeq",1)
		CLNG ABCDE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		CLNG A 0 A_JumpIfInventory("PillsSeq",1,"ChargeLoop1")
		CLNG A 0 A_ReFire("ChargeCheck1")
		Goto Release1
	ChargeCheck1:
		CLNG A 0 A_JumpIfInventory("RawketAmmo",7,"Charge2")
		Goto Release1
    Charge2:
		CLNG A 0 A_PlaySound("Weapons/Colonel/Alt2",5,1.0)
		CLNF A 0 A_Quake(3,70,0,64,"none")
		CLNG A 0 A_GiveInventory("PillsSeq",9)
	ChargeLoop2:
	    CLNG A 0 A_TakeInventory("PillsSeq",1)
		CLNG ABCDE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		CLNG A 0 A_JumpIfInventory("PillsSeq",1,"ChargeLoop2")
		CLNG A 0 A_ReFire("ChargeCheck2")
		Goto Release2
	ChargeCheck2:
		CLNG A 0 A_JumpIfInventory("RawketAmmo",15,"Charge3")
		Goto Release2
    Charge3:
		CLNG A 0 A_PlaySound("Weapons/Colonel/Alt3",5,1.0)
		CLNF A 0 A_Quake(4,60,0,64,"none")
		CLNG A 0 A_GiveInventory("PillsSeq",14)
	ChargeLoop3:
	    CLNG A 0 A_TakeInventory("PillsSeq",1)
		CLNG ABCD 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		CLNG A 0 A_JumpIfInventory("PillsSeq",1,"ChargeLoop3")
		CLNG A 0 A_ReFire("ChargeCheck3")
		Goto Release3
	ChargeCheck3:
		CLNG A 0 A_JumpIfInventory("RawketAmmo",20,"Charge4")
		Goto Release3
    Charge4:
		CLNG A 0 A_PlaySound("Weapons/Colonel/Alt4",5,1.0)
		CLNF A 0 A_Quake(5,100,0,64,"none")
		CLNG A 0 A_GiveInventory("PillsSeq",29)
	ChargeLoop4:
	    CLNG A 0 A_TakeInventory("PillsSeq",1)
		CLNG ACE 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
		CLNG A 0 A_JumpIfInventory("PillsSeq",1,"ChargeLoop4")
		Goto Release4
	Release1:
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Add",1,1.0)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/AltFire",5,0.8)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Alt",6,1.0)
		CLNF A 0 A_Recoil(7)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_SetAngle(Angle-2.5)
		CLNF A 0 A_SetPitch(Pitch-2.5)
		CLNF A 0 A_SetBlend("Red",0.1,15)
		CLNF A 0 A_Quake(2,9,0,64,"none")
		CLNF A 0 A_TakeInventory("RawketAmmo",5)
		CLNF A 0 A_FireCustomMissile("Mediblast1",0, 0, 10) 
		CLNF A 1 Bright Offset(15,47) A_ZoomFactor(0.9575)
		CLNF A 0 A_SetAngle(Angle-2)
		CLNF A 0 A_SetPitch(Pitch-2)
      	CLNF B 1 Bright Offset(12,44) A_ZoomFactor(0.955)
		CLNF A 0 A_SetAngle(Angle-1.5)
		CLNF A 0 A_SetPitch(Pitch-1.5)
		CLNG A 1 Offset(9,41) A_ZoomFactor(0.96)
		CLNF A 0 A_SetAngle(Angle-0.75)
		CLNF A 0 A_SetPitch(Pitch-0.75)
      	CLNG B 1 Offset(7,39) A_ZoomFactor(0.965)
		CLNF A 0 A_SetAngle(Angle-0.5)
		CLNF A 0 A_SetPitch(Pitch-0.5)
      	CLNG C 1 Offset(5,37) A_ZoomFactor(0.97)
		CLNF A 0 A_SetAngle(Angle-0.25)
		CLNF A 0 A_SetPitch(Pitch-0.25)
      	CLNG D 1 Offset(4,36) A_ZoomFactor(0.975)
      	CLNG E 1 Offset(3,35) A_ZoomFactor(0.98)
      	CLNG A 1 Offset(2,34) A_ZoomFactor(0.985)
      	CLNG B 1 Offset(1,33) A_ZoomFactor(0.99)
      	CLNG C 1 Offset(0,32) A_ZoomFactor(0.995)
      	CLNG D 1 A_ZoomFactor(1)
      	CLNG EABCDE 1 A_WeaponReady(WRF_NOBOB)
      	CLNG AB 2 A_WeaponReady(WRF_NOBOB)
      	CLNG CDE 3 A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Release2:
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Add",1,1.0)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/AltFire",5,0.8)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Alt",6,1.0)
		CLNF A 0 A_Recoil(10)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_SetAngle(Angle-3.5)
		CLNF A 0 A_SetPitch(Pitch-3.5)
		CLNF A 0 A_SetBlend("Red",0.15,20)
		CLNF A 0 A_Quake(3,10,0,96,"none")
		CLNF A 0 A_TakeInventory("RawketAmmo",10)
		CLNF A 0 A_FireCustomMissile("Mediblast2",0, 0, 10) 
		CLNF A 1 Bright Offset(17,49) A_ZoomFactor(0.945)
		CLNF A 0 A_SetAngle(Angle-2.5)
		CLNF A 0 A_SetPitch(Pitch-2.5)
      	CLNF B 1 Bright Offset(14,46) A_ZoomFactor(0.95)
		CLNF A 0 A_SetAngle(Angle-2)
		CLNF A 0 A_SetPitch(Pitch-2)
		CLNG A 1 Offset(11,43) A_ZoomFactor(0.96)
		CLNF A 0 A_SetAngle(Angle-1)
		CLNF A 0 A_SetPitch(Pitch-1)
      	CLNG B 1 Offset(9,41) A_ZoomFactor(0.965)
		CLNF A 0 A_SetAngle(Angle-0.75)
		CLNF A 0 A_SetPitch(Pitch-0.75)
      	CLNG C 1 Offset(7,39) A_ZoomFactor(0.97)
		CLNF A 0 A_SetAngle(Angle-0.5)
		CLNF A 0 A_SetPitch(Pitch-0.5)
      	CLNG D 1 Offset(5,37) A_ZoomFactor(0.975)
      	CLNG E 1 Offset(3,35) A_ZoomFactor(0.98)
      	CLNG A 1 Offset(2,34) A_ZoomFactor(0.985)
      	CLNG B 1 Offset(1,33) A_ZoomFactor(0.99)
      	CLNG C 1 Offset(0,32) A_ZoomFactor(0.995)
      	CLNG D 1 A_ZoomFactor(1)
      	CLNG EABCDE 1 A_WeaponReady(WRF_NOBOB)
      	CLNG AB 2 A_WeaponReady(WRF_NOBOB)
      	CLNG CDE 3 A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Release3:
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Add",1,1.0)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/AltFire",5,0.8)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Alt",6,1.0)
		CLNF A 0 A_Recoil(13)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_FireCustomMissile("Mediblast3",0, 0, 10) 
		CLNF A 0 A_SetAngle(Angle-4.5)
		CLNF A 0 A_SetPitch(Pitch-4.5)
		CLNF A 0 A_SetBlend("Red",0.2,25)
		CLNF A 0 A_Quake(4,11,0,128,"none")
		CLNF A 0 A_TakeInventory("RawketAmmo",15)
		CLNF A 1 Bright Offset(19,51) A_ZoomFactor(0.93)
		CLNF A 0 A_SetAngle(Angle-3.5)
		CLNF A 0 A_SetPitch(Pitch-3.5)
      	CLNF B 1 Bright Offset(17,49) A_ZoomFactor(0.94)
		CLNF A 0 A_SetAngle(Angle-2.5)
		CLNF A 0 A_SetPitch(Pitch-2.5)
		CLNG A 1 Offset(14,46) A_ZoomFactor(0.95)
		CLNF A 0 A_SetAngle(Angle-1.5)
		CLNF A 0 A_SetPitch(Pitch-1.5)
      	CLNG B 1 Offset(11,43) A_ZoomFactor(0.96)
		CLNF A 0 A_SetAngle(Angle-1)
		CLNF A 0 A_SetPitch(Pitch-1)
      	CLNG C 1 Offset(9,41) A_ZoomFactor(0.97)
		CLNF A 0 A_SetAngle(Angle-0.5)
		CLNF A 0 A_SetPitch(Pitch-0.5)
      	CLNG D 1 Offset(6,38) A_ZoomFactor(0.975)
		CLNF A 0 A_SetAngle(Angle-0.25)
		CLNF A 0 A_SetPitch(Pitch-0.25)
      	CLNG E 1 Offset(4,36) A_ZoomFactor(0.98)
      	CLNG A 1 Offset(2,34) A_ZoomFactor(0.985)
      	CLNG B 1 Offset(1,33) A_ZoomFactor(0.99)
      	CLNG C 1 Offset(0,32) A_ZoomFactor(0.995)
      	CLNG D 1 A_ZoomFactor(1)
      	CLNG EABCDE 1 A_WeaponReady(WRF_NOBOB)
      	CLNG AB 2 A_WeaponReady(WRF_NOBOB)
      	CLNG CDE 3 A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Release4:
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Add",1,1.0)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/AltFire",5,0.8)
		TNT1 A 0 A_PlaySound("Weapons/Colonel/Alt",6,1.0)
		CLNF A 0 A_Recoil(17)
		CLNF A 0 A_GunFlash
		CLNF A 0 A_FireCustomMissile("Mediblast4",0, 0, 10) 
		CLNF A 0 A_SetAngle(Angle-5.5)
		CLNF A 0 A_SetPitch(Pitch-5.5)
		CLNF A 0 A_SetBlend("Red",0.3,35)
		CLNF A 0 A_Quake(5,13,0,128,"none")
		CLNF A 0 A_TakeInventory("RawketAmmo",20)
		CLNF A 1 Bright Offset(21,53) A_ZoomFactor(0.92)
		CLNF A 0 A_SetAngle(Angle-4.5)
		CLNF A 0 A_SetPitch(Pitch-4.5)
      	CLNF B 1 Bright Offset(19,51) A_ZoomFactor(0.93)
		CLNF A 0 A_SetAngle(Angle-3.5)
		CLNF A 0 A_SetPitch(Pitch-3.5)
		CLNG A 1 Offset(17,49) A_ZoomFactor(0.94)
		CLNF A 0 A_SetAngle(Angle-2.5)
		CLNF A 0 A_SetPitch(Pitch-2.5)
      	CLNG B 1 Offset(14,46) A_ZoomFactor(0.95)
		CLNF A 0 A_SetAngle(Angle-1.5)
		CLNF A 0 A_SetPitch(Pitch-1.5)
      	CLNG C 1 Offset(11,43) A_ZoomFactor(0.96)
		CLNF A 0 A_SetAngle(Angle-1)
		CLNF A 0 A_SetPitch(Pitch-1)
      	CLNG D 1 Offset(8,40) A_ZoomFactor(0.97)
		CLNF A 0 A_SetAngle(Angle-0.5)
		CLNF A 0 A_SetPitch(Pitch-0.5)
      	CLNG E 1 Offset(6,38) A_ZoomFactor(0.98)
		CLNF A 0 A_SetAngle(Angle-0.25)
		CLNF A 0 A_SetPitch(Pitch-0.25)
      	CLNG A 1 Offset(4,36) A_ZoomFactor(0.985)
      	CLNG B 1 Offset(2,34) A_ZoomFactor(0.99)
      	CLNG C 1 Offset(0,32) A_ZoomFactor(0.995)
      	CLNG D 1 A_ZoomFactor(1)
      	CLNG EABCDE 1 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
      	CLNG AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
      	CLNG CDE 3 A_WeaponReady(WRF_NOBOB)
		Goto Ready
	Flash:
		TNT1 A 3 A_Light2
		TNT1 A 3 A_Light1
		TNT1 A 1 A_Light0
		Stop
	}
}

ACTOR PillsSeq : Inventory { Inventory.MaxAmount 26 }
